package com.mycode.simplefactory02.model;

public class Factory {

    // 静态工厂方法
    public static Product getProduct(String arg) {
        Product product = null;
        if (arg.equalsIgnoreCase("A")) {
            product = new ConcreteProductA();
            // 初始化设置 product
        }
        else if (arg.equalsIgnoreCase("B")) {
            product = new ConcreteProductB();
            // 初始化设置 product
        }
        return product;
    }
}
